<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: RubyMotionQuery::RMQ
  
    &mdash; Documentation by YARD 0.8.7.3
  
</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '../';
  framesUrl = "../frames.html#!" + escape(window.location.href);
</script>


  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (R)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../RubyMotionQuery.html" title="RubyMotionQuery (module)">RubyMotionQuery</a></span></span>
     &raquo; 
    <span class="title">RMQ</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="../class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="../method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="../file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><h1>Class: RubyMotionQuery::RMQ
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></span>
      
        <ul class="fullTree">
          <li><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></li>
          
            <li class="next">RubyMotionQuery::RMQ</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">motion/ruby_motion_query/base.rb<span class="defines">,<br />
  motion/ruby_motion_query/app.rb,<br /> motion/ruby_motion_query/font.rb,<br /> motion/ruby_motion_query/tags.rb,<br /> motion/ruby_motion_query/color.rb,<br /> motion/ruby_motion_query/utils.rb,<br /> motion/ruby_motion_query/image.rb,<br /> motion/ruby_motion_query/events.rb,<br /> motion/ruby_motion_query/format.rb,<br /> motion/ruby_motion_query/device.rb,<br /> motion/ruby_motion_query/factory.rb,<br /> motion/ruby_motion_query/actions.rb,<br /> motion/ruby_motion_query/version.rb,<br /> motion/ruby_motion_query/subviews.rb,<br /> motion/ruby_motion_query/position.rb,<br /> motion/ruby_motion_query/traverse.rb,<br /> motion/ruby_motion_query/selectors.rb,<br /> motion/ruby_motion_query/stylesheet.rb,<br /> motion/ruby_motion_query/enumerablish.rb</span>
</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    
<p>The main class for RubyMotionQuery</p>

<p>What's an rmq instance?</p>
<ul><li>
<p>an rmq instance is an array-like object containing UIViews</p>
</li><li>
<p>rmq() never returns nil. If nothing is selected, it's an empty [ ]
array-like object</p>
</li><li>
<p>an rmq object always (almost always) returns either itself or a new rmq
object. This is  how chaining works. You do not need to worry if an rmq is
blank or not, everything  always works without throwing a nil exception</p>
</li><li>
<p>jQuery uses the DOM, what is rmq using for the "DOM"? It uses the
controller it was  called in. The "DOM" is the controller's subview tree.
If you call rmq inside a view, it will  attach to the controller that the
view is currently in or to the current screen's controller</p>
</li></ul>


  </div>
</div>
<div class="tags">
  

</div>






  
    <h2>
      Class Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#app-class_method" title="app (class method)">+ (App) <strong>app</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#color-class_method" title="color (class method)">+ (Color) <strong>color</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#controller_for_view-class_method" title="controller_for_view (class method)">+ (UIViewController) <strong>controller_for_view</strong>(view) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>The controller the view it is sitting in, or nil if it's not sitting
anywhere in particular.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#create_with_array_and_selectors-class_method" title="create_with_array_and_selectors (class method)">+ (RMQ) <strong>create_with_array_and_selectors</strong>(array, selectors, context, parent_rmq = nil) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>This is used internally, to get a new rmq instance, just call "rmq" in your
view or controller or just create a new one like so:
RubyMotionQuery::RMQ.new.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#create_with_selectors-class_method" title="create_with_selectors (class method)">+ (RMQ) <strong>create_with_selectors</strong>(selectors, context, parent_rmq = nil) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>This is used internally, to get a new rmq instance, just call "rmq" in your
view or controller or just create a new one like so:
RubyMotionQuery::RMQ.new.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#debugging%3D-class_method" title="debugging= (class method)">+ (Object) <strong>debugging=</strong>(flag) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#debugging%3F-class_method" title="debugging? (class method)">+ (Boolean) <strong>debugging?</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#device-class_method" title="device (class method)">+ (Device) <strong>device</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#font-class_method" title="font (class method)">+ (Font) <strong>font</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#format-class_method" title="format (class method)">+ (Format) <strong>format</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#image-class_method" title="image (class method)">+ (ImageUtils) <strong>image</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#is_blank%3F-class_method" title="is_blank? (class method)">+ (Boolean) <strong>is_blank?</strong>(o) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>This is purposely not blank? as to not conflict with many libraries that
add .blank? to Object.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#is_class%3F-class_method" title="is_class? (class method)">+ (Boolean) <strong>is_class?</strong>(o) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#view_to_s-class_method" title="view_to_s (class method)">+ (String) <strong>view_to_s</strong>(view) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Mainly used for console and logging.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#weak_ref-class_method" title="weak_ref (class method)">+ (Object) <strong>weak_ref</strong>(o) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Creates a weak reference to an object.</p>
</div></span>
  
</li>

      
    </ul>
  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#%3C%3C-instance_method" title="#&lt;&lt; (instance method)">- (RMQ) <strong>&lt;&lt;</strong>(value) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#%5B%5D-instance_method" title="#[] (instance method)">- (RMQ) <strong>[]</strong>(i) </a>
    

    
      (also: #eq)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#add_subview-instance_method" title="#add_subview (instance method)">- (RMQ) <strong>add_subview</strong>(view_or_constant, opts = {}) </a>
    

    
      (also: #insert)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#all-instance_method" title="#all (instance method)">- (RMQ) <strong>all</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>All selected views.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#and-instance_method" title="#and (instance method)">- (RMQ) <strong>and</strong>(*working_selectors) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>A new rmq instance reducing selected views to those that match selectors
provided.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#and_self-instance_method" title="#and_self (instance method)">- (RMQ) <strong>and_self</strong> </a>
    

    
      (also: #add_self)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>A new rmq instance adding the context to the selected views.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#app-instance_method" title="#app (instance method)">- (App) <strong>app</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#append-instance_method" title="#append (instance method)">- (RMQ) <strong>append</strong>(view_or_constant, style = nil, opts = {}) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#apply_style-instance_method" title="#apply_style (instance method)">- (RMQ) <strong>apply_style</strong>(style_name) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#attr-instance_method" title="#attr (instance method)">- (RMQ) <strong>attr</strong>(new_settings) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#build-instance_method" title="#build (instance method)">- (Object) <strong>build</strong>(view, style = nil, opts = {}) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Build a view, similar to create and append, but only inits an existing
view.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#children-instance_method" title="#children (instance method)">- (RMQ) <strong>children</strong>(*working_selectors) </a>
    

    
      (also: #subviews)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Instance selecting the children of the selected view(s).</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#clear_tags-instance_method" title="#clear_tags (instance method)">- (RMQ) <strong>clear_tags</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#closest-instance_method" title="#closest (instance method)">- (RMQ) <strong>closest</strong>(*working_selectors) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>For each selected view, get the first view that matches the selector(s) by
testing the view's parent and  traversing up through its ancestors in the
tree.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#color-instance_method" title="#color (instance method)">- (Color) <strong>color</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#context-instance_method" title="#context (instance method)">- (Object) <strong>context</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#context%3D-instance_method" title="#context= (instance method)">- (Object) <strong>context=</strong>(value) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>This is mostly used internally.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#context_or_context_view-instance_method" title="#context_or_context_view (instance method)">- (UIView) <strong>context_or_context_view</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>The context is where rmq was created (not the selectors).</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#create-instance_method" title="#create (instance method)">- (RMQ) <strong>create</strong>(view_or_constant, style = nil, opts = {}) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Creates a view then returns an rmq with that view in it.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#create_blank_rmq-instance_method" title="#create_blank_rmq (instance method)">- (RMQ) <strong>create_blank_rmq</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>This is used internally, to get a new rmq instance, just call "rmq" in your
view or controller or just create a new one like so:
RubyMotionQuery::RMQ.new.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#create_rmq_in_context-instance_method" title="#create_rmq_in_context (instance method)">- (RMQ) <strong>create_rmq_in_context</strong>(*selectors) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>This is used internally, to get a new rmq instance, just call "rmq" in your
view or controller or just create a new one like so:
RubyMotionQuery::RMQ.new.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#detect-instance_method" title="#detect (instance method)">- (RMQ) <strong>detect</strong>(&amp;block) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#device-instance_method" title="#device (instance method)">- (Device) <strong>device</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#distribute-instance_method" title="#distribute (instance method)">- (Object) <strong>distribute</strong>(type = :vertical, params = {}) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#each-instance_method" title="#each (instance method)">- (RMQ) <strong>each</strong>(&amp;block) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#end-instance_method" title="#end (instance method)">- (RMQ) <strong>end</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>The parent rmq instance.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#filter-instance_method" title="#filter (instance method)">- (RMQ) <strong>filter</strong>(opts = {}, &amp;block) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Most everything uses filter to do its work.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#find-instance_method" title="#find (instance method)">- (RMQ) <strong>find</strong>(*working_selectors) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Get the descendants of each view in the current set of selected views,
filtered by a selector(s).</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#first-instance_method" title="#first (instance method)">- (RMQ) <strong>first</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#focus-instance_method" title="#focus (instance method)">- (RMQ) <strong>focus</strong> </a>
    

    
      (also: #become_first_responder)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Sets the last selected view as the first responder.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#font-instance_method" title="#font (instance method)">- (Font) <strong>font</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#format-instance_method" title="#format (instance method)">- (Format) <strong>format</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#get-instance_method" title="#get (instance method)">- (UIView or Array) <strong>get</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Returns a view or array of views.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#grep-instance_method" title="#grep (instance method)">- (RMQ) <strong>grep</strong>(&amp;block) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#hide-instance_method" title="#hide (instance method)">- (RMQ) <strong>hide</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#image-instance_method" title="#image (instance method)">- (ImageUtils) <strong>image</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (RMQ) <strong>initialize</strong> </a>
    

    
  </span>
  
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>A new instance of RMQ.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#inject-instance_method" title="#inject (instance method)">- (RMQ) <strong>inject</strong>(o, &amp;block) </a>
    

    
      (also: #reduce)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#inspect-instance_method" title="#inspect (instance method)">- (String) <strong>inspect</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Changed inspect to be useful.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#last-instance_method" title="#last (instance method)">- (RMQ) <strong>last</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#length-instance_method" title="#length (instance method)">- (Integer) <strong>length</strong> </a>
    

    
      (also: #size, #count)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Number of views selected.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#location_in-instance_method" title="#location_in (instance method)">- (Array) <strong>location_in</strong>(view) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Or [CGSize].</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#location_in_root_view-instance_method" title="#location_in_root_view (instance method)">- (Array) <strong>location_in_root_view</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Or [CGSize].</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#log-instance_method" title="#log (instance method)">- (String) <strong>log</strong>(opt = nil) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Super useful in the console.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#map-instance_method" title="#map (instance method)">- (RMQ) <strong>map</strong>(&amp;block) </a>
    

    
      (also: #collect)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#move-instance_method" title="#move (instance method)">- (RMQ) <strong>move</strong>(opts) </a>
    

    
      (also: #resize)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#next-instance_method" title="#next (instance method)">- (RMQ) <strong>next</strong>(*working_selectors) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Sibling above to the selected view(s).</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#not-instance_method" title="#not (instance method)">- (RMQ) <strong>not</strong>(*working_selectors) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>A new rmq instance removing selected views that match selectors provided.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#nudge-instance_method" title="#nudge (instance method)">- (RMQ) <strong>nudge</strong>(opts) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#off-instance_method" title="#off (instance method)">- (RMQ) <strong>off</strong>(*events) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Removes events/gestures from all views selected.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#on-instance_method" title="#on (instance method)">- (Object) <strong>on</strong>(event, args = {}, &amp;block) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Options for gestures  :cancels_touches_in_view   :delegate   :taps_required
:fingers_required   :maximum_number_of_touches   :minimum_number_of_touches
:allowable_movement   :minimum_press_duration   :direction   :rotation  
:scale .</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#origin_views-instance_method" title="#origin_views (instance method)">- (Array) <strong>origin_views</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>The view(s) this rmq was derived from.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#parent-instance_method" title="#parent (instance method)">- (RMQ) <strong>parent</strong> </a>
    

    
      (also: #superview)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Rmq instance selecting the parent of the selected view(s).</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#parent_rmq-instance_method" title="#parent_rmq (instance method)">- (RMQ) <strong>parent_rmq</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Untested and I don' think it's getting set right in some situations.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#parent_rmq%3D-instance_method" title="#parent_rmq= (instance method)">- (Object) <strong>parent_rmq=</strong>(value) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#parents-instance_method" title="#parents (instance method)">- (RMQ) <strong>parents</strong>(*working_selectors) </a>
    

    
      (also: #superviews)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>of the selected view(s).</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#prev-instance_method" title="#prev (instance method)">- (RMQ) <strong>prev</strong>(*working_selectors) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Sibling below to the selected view(s).</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#reapply_styles-instance_method" title="#reapply_styles (instance method)">- (RMQ) <strong>reapply_styles</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#reject-instance_method" title="#reject (instance method)">- (RMQ) <strong>reject</strong>(&amp;block) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#remove-instance_method" title="#remove (instance method)">- (RMQ) <strong>remove</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#resize_to_fit_subviews-instance_method" title="#resize_to_fit_subviews (instance method)">- (Object) <strong>resize_to_fit_subviews</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#root%3F-instance_method" title="#root? (instance method)">- (Boolean) <strong>root?</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Is this rmq a root instance? .</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#root_view-instance_method" title="#root_view (instance method)">- (UIView) <strong>root_view</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Root view of this rmq instance's controller.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#select-instance_method" title="#select (instance method)">- (RMQ) <strong>select</strong>(&amp;block) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#selected-instance_method" title="#selected (instance method)">- (Array) <strong>selected</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>The UIViews currently selected.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#selected%3D-instance_method" title="#selected= (instance method)">- (Object) <strong>selected=</strong>(value) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Do not use.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#selectors-instance_method" title="#selectors (instance method)">- (Array) <strong>selectors</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>The selectors, which is what you used for the query.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#selectors%3D-instance_method" title="#selectors= (instance method)">- (Object) <strong>selectors=</strong>(value) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Do not use.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#send-instance_method" title="#send (instance method)">- (RMQ) <strong>send</strong>(method, args = nil) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#show-instance_method" title="#show (instance method)">- (RMQ) <strong>show</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#siblings-instance_method" title="#siblings (instance method)">- (RMQ) <strong>siblings</strong>(*working_selectors) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Siblings of the selected view(s).</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#style-instance_method" title="#style (instance method)">- (RMQ) <strong>style</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#styler_for-instance_method" title="#styler_for (instance method)">- (Object) <strong>styler_for</strong>(view) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#stylesheet-instance_method" title="#stylesheet (instance method)">- (RubyMotionQuery::Stylesheet) <strong>stylesheet</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#stylesheet%3D-instance_method" title="#stylesheet= (instance method)">- (RMQ) <strong>stylesheet=</strong>(value) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#tag-instance_method" title="#tag (instance method)">- (RMQ) <strong>tag</strong>(*tag_or_tags) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Add tags You can optionally store a value in the tag, which can be super
useful in some rare situations.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#to_a-instance_method" title="#to_a (instance method)">- (Array) <strong>to_a</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#toggle-instance_method" title="#toggle (instance method)">- (RMQ) <strong>toggle</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#toggle_enabled-instance_method" title="#toggle_enabled (instance method)">- (RMQ) <strong>toggle_enabled</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#tree_to_s-instance_method" title="#tree_to_s (instance method)">- (Object) <strong>tree_to_s</strong>(selected_views, depth = 0) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#unshift-instance_method" title="#unshift (instance method)">- (RMQ) <strong>unshift</strong>(view_or_constant, style = nil, opts = {}) </a>
    

    
      (also: #prepend)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#version-instance_method" title="#version (instance method)">- (Object) <strong>version</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#view_controller-instance_method" title="#view_controller (instance method)">- (UIViewController) <strong>view_controller</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>When you call rmq within a controller or view, a new instance of RMQ is
created with the selectors you may or may not have supplied.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#view_controller%3D-instance_method" title="#view_controller= (instance method)">- (Object) <strong>view_controller=</strong>(value) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#weak_view_controller%3D-instance_method" title="#weak_view_controller= (instance method)">- (Object) <strong>weak_view_controller=</strong>(value) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#window-instance_method" title="#window (instance method)">- (UIWindow) <strong>window</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Window of the root_view.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#wrap-instance_method" title="#wrap (instance method)">- (Object) <strong>wrap</strong>(*views) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Wraps 1 or more views in an rmq instance.</p>
</div></span>
  
</li>

      
    </ul>
  

<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <h3 class="signature first" id="initialize-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>initialize</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns a new instance of RMQ</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


20
21
22</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 20</span>

<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
  <span class='ivar'>@selected_dirty</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
  
</div>


  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="app-class_method">
  
    + (<tt><span class='object_link'><a href="App.html" title="RubyMotionQuery::App (class)">App</a></span></tt>) <strong>app</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="App.html" title="RubyMotionQuery::App (class)">App</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


9
10
11</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 9</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_app'>app</span>
  <span class='const'>App</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="color-class_method">
  
    + (<tt><span class='object_link'><a href="Color.html" title="RubyMotionQuery::Color (class)">Color</a></span></tt>) <strong>color</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Color.html" title="RubyMotionQuery::Color (class)">Color</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


4
5
6</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/color.rb', line 4</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_color'>color</span>
  <span class='const'>Color</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="controller_for_view-class_method">
  
    + (<tt><span class='object_link'><a href="../UIViewController.html" title="UIViewController (class)">UIViewController</a></span></tt>) <strong>controller_for_view</strong>(view) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns The controller the view it is sitting in, or nil if it’s not
sitting anywhere in particular</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>view</span>
      
      
        <span class='type'></span>
      
      
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="../UIViewController.html" title="UIViewController (class)">UIViewController</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The controller the view it is sitting in, or nil if it’s not sitting
anywhere in particular</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/utils.rb', line 28</span>

<span class='kw'>def</span> <span class='id identifier rubyid_controller_for_view'>controller_for_view</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
  <span class='kw'>if</span> <span class='id identifier rubyid_view'>view</span> <span class='op'>&amp;&amp;</span> <span class='lparen'>(</span><span class='id identifier rubyid_vc'>vc</span> <span class='op'>=</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_vc'>vc</span> 
  <span class='kw'>else</span>

    <span class='comment'># Non-recursive for speed
</span>    <span class='kw'>while</span> <span class='id identifier rubyid_view'>view</span>
      <span class='id identifier rubyid_view'>view</span> <span class='op'>=</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_nextResponder'>nextResponder</span>
      <span class='kw'>if</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>UIViewController</span><span class='rparen'>)</span>
        <span class='kw'>break</span>
      <span class='kw'>elsif</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>UIView</span><span class='rparen'>)</span>
        <span class='kw'>if</span> <span class='id identifier rubyid_vc'>vc</span> <span class='op'>=</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span>
          <span class='id identifier rubyid_view'>view</span> <span class='op'>=</span> <span class='id identifier rubyid_vc'>vc</span>
          <span class='kw'>break</span>
        <span class='kw'>end</span>
      <span class='kw'>else</span>
        <span class='id identifier rubyid_view'>view</span> <span class='op'>=</span> <span class='kw'>nil</span>
      <span class='kw'>end</span>
    <span class='kw'>end</span>

    <span class='id identifier rubyid_view'>view</span>

  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="create_with_array_and_selectors-class_method">
  
    + (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>create_with_array_and_selectors</strong>(array, selectors, context, parent_rmq = nil) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>This is used internally, to get a new rmq instance, just call "rmq" in your
view or controller or just create a new one like so:
RubyMotionQuery::RMQ.new</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


37
38
39
40
41
42
43
44</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/factory.rb', line 37</span>

<span class='kw'>def</span> <span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_array'>array</span><span class='comma'>,</span> <span class='id identifier rubyid_selectors'>selectors</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='comma'>,</span> <span class='id identifier rubyid_parent_rmq'>parent_rmq</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span> <span class='comment'># TODO, convert to opts
</span>  <span class='id identifier rubyid_q'>q</span> <span class='op'>=</span> <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
  <span class='id identifier rubyid_q'>q</span><span class='period'>.</span><span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span>
  <span class='id identifier rubyid_q'>q</span><span class='period'>.</span><span class='id identifier rubyid_selectors'>selectors</span> <span class='op'>=</span> <span class='id identifier rubyid_selectors'>selectors</span>
  <span class='id identifier rubyid_q'>q</span><span class='period'>.</span><span class='id identifier rubyid_parent_rmq'>parent_rmq</span> <span class='op'>=</span> <span class='id identifier rubyid_parent_rmq'>parent_rmq</span>
  <span class='id identifier rubyid_q'>q</span><span class='period'>.</span><span class='id identifier rubyid_selected'>selected</span> <span class='op'>=</span> <span class='id identifier rubyid_array'>array</span> <span class='comment'># Must be last
</span>  <span class='id identifier rubyid_q'>q</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="create_with_selectors-class_method">
  
    + (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>create_with_selectors</strong>(selectors, context, parent_rmq = nil) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>This is used internally, to get a new rmq instance, just call "rmq" in your
view or controller or just create a new one like so:
RubyMotionQuery::RMQ.new</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


25
26
27
28
29
30
31</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/factory.rb', line 25</span>

<span class='kw'>def</span> <span class='id identifier rubyid_create_with_selectors'>create_with_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_selectors'>selectors</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='comma'>,</span> <span class='id identifier rubyid_parent_rmq'>parent_rmq</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_q'>q</span> <span class='op'>=</span> <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
  <span class='id identifier rubyid_q'>q</span><span class='period'>.</span><span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span>
  <span class='id identifier rubyid_q'>q</span><span class='period'>.</span><span class='id identifier rubyid_parent_rmq'>parent_rmq</span> <span class='op'>=</span> <span class='id identifier rubyid_parent_rmq'>parent_rmq</span>
  <span class='id identifier rubyid_q'>q</span><span class='period'>.</span><span class='id identifier rubyid_selectors'>selectors</span> <span class='op'>=</span> <span class='id identifier rubyid_selectors'>selectors</span>
  <span class='id identifier rubyid_q'>q</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="debugging=-class_method">
  
    + (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>debugging=</strong>(flag) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


309
310
311</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 309</span>

<span class='kw'>def</span> <span class='id identifier rubyid_debugging='>debugging=</span><span class='lparen'>(</span><span class='id identifier rubyid_flag'>flag</span><span class='rparen'>)</span>
  <span class='ivar'>@debugging</span> <span class='op'>=</span> <span class='id identifier rubyid_flag'>flag</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="debugging?-class_method">
  
    + (<tt>Boolean</tt>) <strong>debugging?</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


305
306
307</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 305</span>

<span class='kw'>def</span> <span class='id identifier rubyid_debugging?'>debugging?</span>
  <span class='ivar'>@debugging</span> <span class='op'>||=</span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rmq_debug</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>true</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="device-class_method">
  
    + (<tt><span class='object_link'><a href="Device.html" title="RubyMotionQuery::Device (class)">Device</a></span></tt>) <strong>device</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Device.html" title="RubyMotionQuery::Device (class)">Device</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


9
10
11</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/device.rb', line 9</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_device'>device</span>
  <span class='const'>Device</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="font-class_method">
  
    + (<tt><span class='object_link'><a href="Font.html" title="RubyMotionQuery::Font (class)">Font</a></span></tt>) <strong>font</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Font.html" title="RubyMotionQuery::Font (class)">Font</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


4
5
6</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/font.rb', line 4</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_font'>font</span>
  <span class='const'>Font</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="format-class_method">
  
    + (<tt><span class='object_link'><a href="Format.html" title="RubyMotionQuery::Format (class)">Format</a></span></tt>) <strong>format</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Format.html" title="RubyMotionQuery::Format (class)">Format</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


9
10
11</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/format.rb', line 9</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span>
  <span class='const'>Format</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="image-class_method">
  
    + (<tt><span class='object_link'><a href="ImageUtils.html" title="RubyMotionQuery::ImageUtils (class)">ImageUtils</a></span></tt>) <strong>image</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="ImageUtils.html" title="RubyMotionQuery::ImageUtils (class)">ImageUtils</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


4
5
6</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/image.rb', line 4</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_image'>image</span>
  <span class='const'>ImageUtils</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="is_blank?-class_method">
  
    + (<tt>Boolean</tt>) <strong>is_blank?</strong>(o) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>This is purposely not blank? as to not conflict with many libraries that
add .blank? to Object</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


18
19
20
21
22
23
24</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/utils.rb', line 18</span>

<span class='kw'>def</span> <span class='id identifier rubyid_is_blank?'>is_blank?</span><span class='lparen'>(</span><span class='id identifier rubyid_o'>o</span><span class='rparen'>)</span>
  <span class='kw'>if</span> <span class='id identifier rubyid_o'>o</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>RubyMotionQuery</span><span class='op'>::</span><span class='const'>RMQ</span><span class='rparen'>)</span>
    <span class='const'>RubyMotionQuery</span><span class='op'>::</span><span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_is_blank?'>is_blank?</span><span class='lparen'>(</span><span class='id identifier rubyid_o'>o</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='rparen'>)</span>
  <span class='kw'>else</span>
    <span class='id identifier rubyid_o'>o</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:empty?</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_o'>o</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>:</span> <span class='op'>!</span><span class='id identifier rubyid_o'>o</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="is_class?-class_method">
  
    + (<tt>Boolean</tt>) <strong>is_class?</strong>(o) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


6
7
8
9
10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/utils.rb', line 6</span>

<span class='kw'>def</span> <span class='id identifier rubyid_is_class?'>is_class?</span><span class='lparen'>(</span><span class='id identifier rubyid_o'>o</span><span class='rparen'>)</span>
  <span class='comment'># This line fails in spec, causes exit without message. It works fine in production
</span>  <span class='comment'>#(o.class == Class) &amp;&amp; (defined?(o) == 'constant')
</span>  
  <span class='comment'># So I'm doing this instead
</span>  <span class='op'>!</span><span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_o'>o</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:name</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_o'>o</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>[A-Z]</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="view_to_s-class_method">
  
    + (<tt>String</tt>) <strong>view_to_s</strong>(view) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Mainly used for console and logging</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


76
77
78
79
80
81
82
83</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/utils.rb', line 76</span>

<span class='kw'>def</span> <span class='id identifier rubyid_view_to_s'>view_to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>  VIEW  class:o </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>  object_id: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='rbrace'>}</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>    RECTANGLE  left: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span><span class='period'>.</span><span class='id identifier rubyid_y'>y</span><span class='rbrace'>}</span><span class='tstring_content'>, top: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span><span class='period'>.</span><span class='id identifier rubyid_y'>y</span><span class='rbrace'>}</span><span class='tstring_content'>, width: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span><span class='rbrace'>}</span><span class='tstring_content'>, height: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span><span class='rbrace'>}</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>    SUPERVIEW  class: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_superview'>superview</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>  object_id: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_superview'>superview</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='rbrace'>}</span><span class='tstring_content'> \n</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_superview'>superview</span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>    SUBVIEWS   count: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_subviews'>subviews</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='rbrace'>}</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span>
  <span class='id identifier rubyid_out'>out</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="weak_ref-class_method">
  
    + (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>weak_ref</strong>(o) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Creates a weak reference to an object. Unlike WeakRef.new provided by
RubyMotion, this will  not wrap a weak ref inside another weak ref (which
causes bugs).</p>

<p>This is fairly performant. It's about twice as slow as WeakRef.new.
However, you can  create a million weak refs in about 651 miliseconds,
compared to 319 for WeakRef.new</p>

<p>Creating a WeakRef with a literal like a string will cause your app to
crash instantly, it's fun, try it. Only create weak refs of variables</p>

<p>foo = RubyMotionQuery::RMQ.weak_ref(bar)</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


64
65
66
67
68
69
70
71</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/utils.rb', line 64</span>

<span class='kw'>def</span> <span class='id identifier rubyid_weak_ref'>weak_ref</span><span class='lparen'>(</span><span class='id identifier rubyid_o'>o</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_weak'>weak</span> <span class='op'>=</span> <span class='const'>WeakRef</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_o'>o</span><span class='rparen'>)</span>
  <span class='kw'>if</span> <span class='id identifier rubyid_weak'>weak</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>WeakRef</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_o'>o</span> <span class='comment'># Already a weak ref, return original
</span>  <span class='kw'>else</span>
    <span class='id identifier rubyid_weak'>weak</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="<<-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>&lt;&lt;</strong>(value) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


8
9
10
11</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/enumerablish.rb', line 8</span>

<span class='kw'>def</span> <span class='op'>&lt;&lt;</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_selected'>selected</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_value'>value</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>UIView</span><span class='rparen'>)</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="[]-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>[]</strong>(i) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='eq-instance_method'>eq</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code>rmq(UILabel)[3]
or
rmq(UILabel)[1..5]</code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


19
20
21</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/enumerablish.rb', line 19</span>

<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_i'>i</span><span class='rparen'>)</span>
  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_selected'>selected</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="add_subview-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>add_subview</strong>(view_or_constant, opts = {}) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='insert-instance_method'>insert</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/subviews.rb', line 12</span>

<span class='kw'>def</span> <span class='id identifier rubyid_add_subview'>add_subview</span><span class='lparen'>(</span><span class='id identifier rubyid_view_or_constant'>view_or_constant</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_subviews_added'>subviews_added</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
  <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:style</span><span class='rbracket'>]</span>

  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_selected_view'>selected_view</span><span class='op'>|</span>
    <span class='id identifier rubyid_created'>created</span> <span class='op'>=</span> <span class='kw'>false</span>
    <span class='id identifier rubyid_appended'>appended</span> <span class='op'>=</span> <span class='kw'>false</span>


    <span class='kw'>if</span> <span class='id identifier rubyid_view_or_constant'>view_or_constant</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>UIView</span><span class='rparen'>)</span>
      <span class='id identifier rubyid_new_view'>new_view</span> <span class='op'>=</span> <span class='id identifier rubyid_view_or_constant'>view_or_constant</span>
    <span class='kw'>else</span>
      <span class='id identifier rubyid_created'>created</span> <span class='op'>=</span> <span class='kw'>true</span>
      <span class='id identifier rubyid_new_view'>new_view</span> <span class='op'>=</span> <span class='id identifier rubyid_create_view'>create_view</span><span class='lparen'>(</span><span class='id identifier rubyid_view_or_constant'>view_or_constant</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
    <span class='kw'>end</span>

    <span class='id identifier rubyid_new_view'>new_view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span>

    <span class='id identifier rubyid_subviews_added'>subviews_added</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_new_view'>new_view</span>

    <span class='kw'>unless</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:do_not_add</span><span class='rbracket'>]</span>
      <span class='kw'>if</span> <span class='id identifier rubyid_at_index'>at_index</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:at_index</span><span class='rbracket'>]</span>
        <span class='id identifier rubyid_selected_view'>selected_view</span><span class='period'>.</span><span class='id identifier rubyid_insertSubview'>insertSubview</span><span class='lparen'>(</span><span class='id identifier rubyid_new_view'>new_view</span><span class='comma'>,</span> <span class='label'>atIndex:</span> <span class='id identifier rubyid_at_index'>at_index</span><span class='rparen'>)</span>
      <span class='kw'>elsif</span> <span class='id identifier rubyid_below_view'>below_view</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:below_view</span><span class='rbracket'>]</span>
        <span class='id identifier rubyid_selected_view'>selected_view</span><span class='period'>.</span><span class='id identifier rubyid_insertSubview'>insertSubview</span><span class='lparen'>(</span><span class='id identifier rubyid_new_view'>new_view</span><span class='comma'>,</span> <span class='label'>belowSubview:</span> <span class='id identifier rubyid_below_view'>below_view</span><span class='rparen'>)</span>
      <span class='kw'>else</span>
        <span class='id identifier rubyid_selected_view'>selected_view</span><span class='period'>.</span><span class='id identifier rubyid_addSubview'>addSubview</span><span class='lparen'>(</span><span class='id identifier rubyid_new_view'>new_view</span><span class='rparen'>)</span>
      <span class='kw'>end</span>

      <span class='id identifier rubyid_appended'>appended</span> <span class='op'>=</span> <span class='kw'>true</span>
    <span class='kw'>end</span>

    <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_stylesheet'>stylesheet</span>
      <span class='id identifier rubyid_apply_style_to_view'>apply_style_to_view</span><span class='lparen'>(</span><span class='id identifier rubyid_new_view'>new_view</span><span class='comma'>,</span> <span class='id identifier rubyid_style'>style</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_style'>style</span>
    <span class='kw'>end</span>

    <span class='kw'>if</span> <span class='id identifier rubyid_created'>created</span>
      <span class='id identifier rubyid_new_view'>new_view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_did_create'>rmq_did_create</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_wrap'>wrap</span><span class='lparen'>(</span><span class='id identifier rubyid_new_view'>new_view</span><span class='rparen'>)</span><span class='rparen'>)</span> 
      <span class='id identifier rubyid_new_view'>new_view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_created'>rmq_created</span>
    <span class='kw'>end</span>
    <span class='id identifier rubyid_new_view'>new_view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_build'>rmq_build</span>
    <span class='id identifier rubyid_new_view'>new_view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_appended'>rmq_appended</span> <span class='kw'>if</span> <span class='id identifier rubyid_appended'>appended</span>
  <span class='kw'>end</span>

  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_subviews_added'>subviews_added</span><span class='comma'>,</span> <span class='id identifier rubyid_selectors'>selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='comma'>,</span> <span class='kw'>self</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="all-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>all</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns All selected views</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='period'>.</span><span class='id identifier rubyid_log'>log</span></code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>All selected views</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


38
39
40</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 38</span>

<span class='kw'>def</span> <span class='id identifier rubyid_all'>all</span>
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span><span class='period'>.</span><span class='id identifier rubyid_rmq'>rmq</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="and-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>and</strong>(*working_selectors) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns A new rmq instance reducing selected views to those that match
selectors provided</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='const'>UIImage</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_and'>and</span><span class='lparen'>(</span><span class='symbol'>:some_tag</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_attr'>attr</span><span class='lparen'>(</span><span class='label'>image:</span> <span class='kw'>nil</span><span class='rparen'>)</span></code></pre>
    
  </div>
<p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>selectors</span>
      
      
        <span class='type'></span>
      
      
      
        &mdash;
        <div class='inline'>
<p>your selector</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>A new rmq instance reducing selected views to those that match selectors
provided</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


48
49
50
51
52
53
54
55</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 48</span>

<span class='kw'>def</span> <span class='kw'>and</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
  <span class='kw'>return</span> <span class='kw'>self</span> <span class='kw'>unless</span> <span class='id identifier rubyid_working_selectors'>working_selectors</span>
  <span class='id identifier rubyid_normalize_selectors'>normalize_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>

  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='comma'>,</span> <span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="and_self-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>and_self</strong> 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='add_self-instance_method'>add_self</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns A new rmq instance adding the context to the selected views</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_children'>children</span><span class='period'>.</span><span class='id identifier rubyid_and_self'>and_self</span></code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>A new rmq instance adding the context to the selected views</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


77
78
79
80
81
82
83
84
85
86</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 77</span>

<span class='kw'>def</span> <span class='id identifier rubyid_and_self'>and_self</span>
  <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parent_rmq'>parent_rmq</span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parent_rmq'>parent_rmq</span><span class='period'>.</span><span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_selected'>selected</span>
    <span class='id identifier rubyid_out'>out</span><span class='period'>.</span><span class='id identifier rubyid_flatten!'>flatten!</span>
    <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_out'>out</span><span class='comma'>,</span> <span class='id identifier rubyid_selectors'>selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='comma'>,</span> <span class='kw'>self</span><span class='rparen'>)</span>
  <span class='kw'>else</span>
    <span class='kw'>self</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="app-instance_method">
  
    - (<tt><span class='object_link'><a href="App.html" title="RubyMotionQuery::App (class)">App</a></span></tt>) <strong>app</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="App.html" title="RubyMotionQuery::App (class)">App</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


4
5
6</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 4</span>

<span class='kw'>def</span> <span class='id identifier rubyid_app'>app</span>
  <span class='const'>App</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="append-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>append</strong>(view_or_constant, style = nil, opts = {}) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


61
62
63
64</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/subviews.rb', line 61</span>

<span class='kw'>def</span> <span class='id identifier rubyid_append'>append</span><span class='lparen'>(</span><span class='id identifier rubyid_view_or_constant'>view_or_constant</span><span class='comma'>,</span> <span class='id identifier rubyid_style'>style</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:style</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_style'>style</span>
  <span class='id identifier rubyid_add_subview'>add_subview</span><span class='lparen'>(</span><span class='id identifier rubyid_view_or_constant'>view_or_constant</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="apply_style-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>apply_style</strong>(style_name) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


29
30
31
32
33
34</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/stylesheet.rb', line 29</span>

<span class='kw'>def</span> <span class='id identifier rubyid_apply_style'>apply_style</span><span class='lparen'>(</span><span class='id identifier rubyid_style_name'>style_name</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_selected_view'>selected_view</span><span class='op'>|</span>
    <span class='id identifier rubyid_apply_style_to_view'>apply_style_to_view</span> <span class='id identifier rubyid_selected_view'>selected_view</span><span class='comma'>,</span> <span class='id identifier rubyid_style_name'>style_name</span>
  <span class='kw'>end</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="attr-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>attr</strong>(new_settings) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


5
6
7
8
9
10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/actions.rb', line 5</span>

<span class='kw'>def</span> <span class='id identifier rubyid_attr'>attr</span><span class='lparen'>(</span><span class='id identifier rubyid_new_settings'>new_settings</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_new_settings'>new_settings</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
      <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_k'>k</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="build-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>build</strong>(view, style = nil, opts = {}) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Build a view, similar to create and append, but only inits an existing
view. Usefull in collectionview cells for example</p>

<p># In your collectionview  rmq.build(cell) unless cell.reused</p>

<p># Then in your cell</p>

<p>def rmq_build</p>

<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_rmq'>rmq</span><span class='period'>.</span><span class='id identifier rubyid_append'>append</span><span class='lparen'>(</span><span class='const'>UIView</span><span class='comma'>,</span> <span class='symbol'>:foo</span><span class='rparen'>)</span></code></pre>

<p>end</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


112
113
114
115
116</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/subviews.rb', line 112</span>

<span class='kw'>def</span> <span class='id identifier rubyid_build'>build</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='comma'>,</span> <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:do_not_add</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>true</span>
  <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:style</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_style'>style</span>
  <span class='id identifier rubyid_add_subview'>add_subview</span> <span class='id identifier rubyid_view'>view</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="children-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>children</strong>(*working_selectors) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='subviews-instance_method'>subviews</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns Instance selecting the children of the selected view(s)</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_children'>children</span><span class='period'>.</span><span class='id identifier rubyid_show'>show</span></code></pre>
    
  </div>
<p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>selectors</span>
      
      
        <span class='type'></span>
      
      
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Instance selecting the children of the selected view(s)</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 162</span>

<span class='kw'>def</span> <span class='id identifier rubyid_children'>children</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_normalize_selectors'>normalize_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>

  <span class='id identifier rubyid_filter'>filter</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_subviews'>subviews</span> <span class='op'>=</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_subviews'>subviews</span>

    <span class='kw'>if</span> <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_is_blank?'>is_blank?</span><span class='lparen'>(</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
      <span class='id identifier rubyid_subviews'>subviews</span>
    <span class='kw'>else</span>
      <span class='id identifier rubyid_subviews'>subviews</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_out'>out</span><span class='comma'>,</span> <span class='id identifier rubyid_subview'>subview</span><span class='op'>|</span>
        <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_subview'>subview</span> <span class='kw'>if</span> <span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_subview'>subview</span><span class='comma'>,</span> <span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
        <span class='id identifier rubyid_out'>out</span>
      <span class='kw'>end</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="clear_tags-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>clear_tags</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


24
25
26
27
28
29</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/tags.rb', line 24</span>

<span class='kw'>def</span> <span class='id identifier rubyid_clear_tags'>clear_tags</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_tags'>tags</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
  <span class='kw'>end</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="closest-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>closest</strong>(*working_selectors) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>For each selected view, get the first view that matches the selector(s) by
testing the view's parent and  traversing up through its ancestors in the
tree</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='period'>.</span><span class='id identifier rubyid_closest'>closest</span><span class='lparen'>(</span><span class='const'>UIScrollView</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='period'>.</span><span class='id identifier rubyid_setContentOffset'>setContentOffset</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span></code></pre>
    
  </div>
<p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>selectors</span>
      
      
        <span class='type'></span>
      
      
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Instance selecting the first parent or grandparent or ancestor up the tree
of the selected view(s)</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


239
240
241
242
243
244
245</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 239</span>

<span class='kw'>def</span> <span class='id identifier rubyid_closest'>closest</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_normalize_selectors'>normalize_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>

  <span class='id identifier rubyid_filter'>filter</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_closest_view'>closest_view</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='comma'>,</span> <span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="color-instance_method">
  
    - (<tt><span class='object_link'><a href="Color.html" title="RubyMotionQuery::Color (class)">Color</a></span></tt>) <strong>color</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Color.html" title="RubyMotionQuery::Color (class)">Color</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


9
10
11</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/color.rb', line 9</span>

<span class='kw'>def</span> <span class='id identifier rubyid_color'>color</span> 
  <span class='const'>Color</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="context-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>context</strong> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


38
39
40</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 38</span>

<span class='kw'>def</span> <span class='id identifier rubyid_context'>context</span>
  <span class='ivar'>@context</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="context=-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>context=</strong>(value) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>This is mostly used internally</p>

<p>If rmq was called in a view, context will be that view. If it was called in
a UIViewController, it will be that controller. If it is called in another
object, it will be current controller's rmq instance and thus context will
be  that controller</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


30
31
32
33
34
35
36</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 30</span>

<span class='kw'>def</span> <span class='id identifier rubyid_context='>context=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
  <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>UIViewController</span><span class='rparen'>)</span>
    <span class='ivar'>@context</span> <span class='op'>=</span> <span class='const'>RubyMotionQuery</span><span class='op'>::</span><span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_weak_ref'>weak_ref</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
  <span class='kw'>else</span>
    <span class='ivar'>@context</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="context_or_context_view-instance_method">
  
    - (<tt><span class='object_link'><a href="../UIView.html" title="UIView (class)">UIView</a></span></tt>) <strong>context_or_context_view</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>The context is where rmq was created (not the selectors).</p>

<p>Normally you are inside a controller or a UIView when you execute the rmq
method.</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="../UIView.html" title="UIView (class)">UIView</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>the controller’s view or the view you are in when calling rmq</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


161
162
163
164
165
166
167</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 161</span>

<span class='kw'>def</span> <span class='id identifier rubyid_context_or_context_view'>context_or_context_view</span>
  <span class='kw'>if</span> <span class='ivar'>@context</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>UIViewController</span><span class='rparen'>)</span>
    <span class='ivar'>@context</span><span class='period'>.</span><span class='id identifier rubyid_view'>view</span>
  <span class='kw'>else</span>
    <span class='ivar'>@context</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="create-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>create</strong>(view_or_constant, style = nil, opts = {}) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Creates a view then returns an rmq with that view in it. It does not add
that  view to the view tree. This is useful for stuff like creating table
cells. You can use the rmq_did_create method, just like you do when you
append a subview</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code>def tableView(table_view, cellForRowAtIndexPath: index_path)
  cell = tableView.dequeueReusableCellWithIdentifier(CELL_IDENTIFIER) || begin 
    rmq.create(StoreCell, :store_cell, reuse_identifier: CELL_IDENTIFIER)
  end
end

class StoreCell &lt; UITableViewCell 
  def rmq_did_create(self_in_rmq)
    self_in_rmq.append(UILabel, :title_label)
  end
end</code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>wrapping the view that was just create</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


93
94
95
96
97
98</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/subviews.rb', line 93</span>

<span class='kw'>def</span> <span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_view_or_constant'>view_or_constant</span><span class='comma'>,</span> <span class='id identifier rubyid_style'>style</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
  <span class='comment'># TODO, refactor so that add_subview uses create, not backwards like it is now
</span>  <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:do_not_add</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>true</span>
  <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:style</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_style'>style</span>
  <span class='id identifier rubyid_add_subview'>add_subview</span> <span class='id identifier rubyid_view_or_constant'>view_or_constant</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="create_blank_rmq-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>create_blank_rmq</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>This is used internally, to get a new rmq instance, just call "rmq" in your
view or controller or just create a new one like so:
RubyMotionQuery::RMQ.new</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


7
8
9</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/factory.rb', line 7</span>

<span class='kw'>def</span> <span class='id identifier rubyid_create_blank_rmq'>create_blank_rmq</span>
  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_selectors'>selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="create_rmq_in_context-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>create_rmq_in_context</strong>(*selectors) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>This is used internally, to get a new rmq instance, just call "rmq" in your
view or controller or just create a new one like so:
RubyMotionQuery::RMQ.new</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


15
16
17</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/factory.rb', line 15</span>

<span class='kw'>def</span> <span class='id identifier rubyid_create_rmq_in_context'>create_rmq_in_context</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_selectors'>selectors</span><span class='rparen'>)</span>
  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_selectors'>create_with_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_selectors'>selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="detect-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>detect</strong>(&amp;block) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


44
45
46
47</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/enumerablish.rb', line 44</span>

<span class='kw'>def</span> <span class='id identifier rubyid_detect'>detect</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> <span class='comment'># Unlike enumerable, detect and find are not the same. See find in transverse
</span>  <span class='kw'>return</span> <span class='kw'>self</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block'>block</span>
  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='ivar'>@selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="device-instance_method">
  
    - (<tt><span class='object_link'><a href="Device.html" title="RubyMotionQuery::Device (class)">Device</a></span></tt>) <strong>device</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Device.html" title="RubyMotionQuery::Device (class)">Device</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


4
5
6</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/device.rb', line 4</span>

<span class='kw'>def</span> <span class='id identifier rubyid_device'>device</span>
  <span class='const'>Device</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="distribute-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>distribute</strong>(type = :vertical, params = {}) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/position.rb', line 40</span>

<span class='kw'>def</span> <span class='id identifier rubyid_distribute'>distribute</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='symbol'>:vertical</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
  <span class='kw'>return</span> <span class='int'>0</span> <span class='kw'>if</span> <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>0</span>

  <span class='id identifier rubyid_margins'>margins</span> <span class='op'>=</span> <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:margins</span><span class='rbracket'>]</span>
  <span class='id identifier rubyid_margin'>margin</span> <span class='op'>=</span> <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:margin</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>0</span>
  <span class='id identifier rubyid_current_end'>current_end</span> <span class='op'>=</span> <span class='kw'>nil</span>

  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
    <span class='id identifier rubyid_st'>st</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_styler_for'>styler_for</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span> <span class='op'>==</span> <span class='int'>0</span>

    <span class='id identifier rubyid_view_margin'>view_margin</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_margins'>margins</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_margins'>margins</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='rparen'>)</span>
      <span class='id identifier rubyid_margins'>margins</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span>
    <span class='kw'>else</span>
      <span class='id identifier rubyid_margin'>margin</span>
    <span class='kw'>end</span>

    <span class='id identifier rubyid_current_end'>current_end</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_top'>top</span> <span class='op'>-</span> <span class='id identifier rubyid_view_margin'>view_margin</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_current_end'>current_end</span>

    <span class='kw'>if</span> <span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:horizontal</span>
      <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_left'>left</span> <span class='op'>=</span> <span class='id identifier rubyid_current_end'>current_end</span> <span class='op'>+</span> <span class='id identifier rubyid_view_margin'>view_margin</span>
      <span class='id identifier rubyid_current_end'>current_end</span> <span class='op'>=</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_right'>right</span>
    <span class='kw'>else</span>
      <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_top'>top</span> <span class='op'>=</span> <span class='id identifier rubyid_current_end'>current_end</span> <span class='op'>+</span> <span class='id identifier rubyid_view_margin'>view_margin</span>
      <span class='id identifier rubyid_current_end'>current_end</span> <span class='op'>=</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_bottom'>bottom</span>
    <span class='kw'>end</span>
    
  <span class='kw'>end</span>

  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="each-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>each</strong>(&amp;block) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


25
26
27
28</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/enumerablish.rb', line 25</span>

<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
  <span class='kw'>return</span> <span class='kw'>self</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block'>block</span>
  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='ivar'>@selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="end-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>end</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns The parent rmq instance</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_test_view'>test_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='const'>UIImageView</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_tag'>tag</span><span class='lparen'>(</span><span class='symbol'>:foo</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_end'>end</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='const'>UILabel</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_tag'>tag</span><span class='lparen'>(</span><span class='symbol'>:bar</span><span class='rparen'>)</span></code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The parent rmq instance</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


93
94
95</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 93</span>

<span class='kw'>def</span> <span class='kw'>end</span>
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parent_rmq'>parent_rmq</span> <span class='op'>||</span> <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="filter-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>filter</strong>(opts = {}, &amp;block) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Most everything uses filter to do its work. This is mostly used internally
but you can use it too. Just pass a block that returns views, it will be
called for every view that is <b>selected</b></p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>return_array</span>
      
      
        <span class='type'></span>
      
      
      
        &mdash;
        <div class='inline'>
<p>returns array not rmq: return_array: true</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>uniq</span>
      
      
        <span class='type'></span>
      
      
      
        &mdash;
        <div class='inline'>
<p>removes duplicate views: uniq: true</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>limit</span>
      
      
        <span class='type'></span>
      
      
      
        &mdash;
        <div class='inline'>
<p>limits the number of views *per selected view*: limit: true</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 13</span>

<span class='kw'>def</span> <span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
  <span class='id identifier rubyid_limit'>limit</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:limit</span><span class='rbracket'>]</span>

  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='kw'>yield</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>unless</span> <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_is_blank?'>is_blank?</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span>
      <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_results'>results</span> 
      <span class='kw'>break</span> <span class='kw'>if</span> <span class='id identifier rubyid_limit'>limit</span> <span class='op'>&amp;&amp;</span> <span class='lparen'>(</span><span class='id identifier rubyid_out'>out</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&gt;=</span> <span class='id identifier rubyid_limit'>limit</span><span class='rparen'>)</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
  <span class='id identifier rubyid_out'>out</span><span class='period'>.</span><span class='id identifier rubyid_flatten!'>flatten!</span>
  <span class='id identifier rubyid_out'>out</span><span class='period'>.</span><span class='id identifier rubyid_uniq!'>uniq!</span> <span class='kw'>if</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:uniq</span><span class='rbracket'>]</span>

  <span class='kw'>if</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:return_array</span><span class='rbracket'>]</span>
    <span class='id identifier rubyid_out'>out</span>
  <span class='kw'>else</span>
    <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_out'>out</span><span class='comma'>,</span> <span class='id identifier rubyid_selectors'>selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='comma'>,</span> <span class='kw'>self</span><span class='rparen'>)</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="find-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>find</strong>(*working_selectors) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Get the descendants of each view in the current set of selected views,
filtered by a selector(s)</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='const'>UIButton</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_show'>show</span></code></pre>
    
  </div>
<p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>selectors</span>
      
      
        <span class='type'></span>
      
      
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Instance selecting the children, grandchildren, etc of the selected view(s)</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 139</span>

<span class='kw'>def</span> <span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_normalize_selectors'>normalize_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>

  <span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span><span class='label'>uniq:</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_subviews'>subviews</span> <span class='op'>=</span> <span class='id identifier rubyid_all_subviews_for'>all_subviews_for</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>

    <span class='kw'>if</span> <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_is_blank?'>is_blank?</span><span class='lparen'>(</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
      <span class='id identifier rubyid_subviews'>subviews</span>
    <span class='kw'>else</span>
      <span class='id identifier rubyid_subviews'>subviews</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_out'>out</span><span class='comma'>,</span> <span class='id identifier rubyid_subview'>subview</span><span class='op'>|</span>
        <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_subview'>subview</span> <span class='kw'>if</span> <span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_subview'>subview</span><span class='comma'>,</span> <span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
        <span class='id identifier rubyid_out'>out</span>
      <span class='kw'>end</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="first-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>first</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


69
70
71</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/enumerablish.rb', line 69</span>

<span class='kw'>def</span> <span class='id identifier rubyid_first'>first</span>
  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="focus-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>focus</strong> 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='become_first_responder-instance_method'>become_first_responder</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Sets the last selected view as the first responder</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span><span class='lparen'>(</span><span class='const'>UITextField</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_focus'>focus</span></code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


32
33
34
35
36
37</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/actions.rb', line 32</span>

<span class='kw'>def</span> <span class='id identifier rubyid_focus'>focus</span>
  <span class='kw'>unless</span> <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_is_blank?'>is_blank?</span><span class='lparen'>(</span><span class='id identifier rubyid_selected'>selected</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_becomeFirstResponder'>becomeFirstResponder</span>
  <span class='kw'>end</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="font-instance_method">
  
    - (<tt><span class='object_link'><a href="Font.html" title="RubyMotionQuery::Font (class)">Font</a></span></tt>) <strong>font</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Font.html" title="RubyMotionQuery::Font (class)">Font</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


9
10
11</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/font.rb', line 9</span>

<span class='kw'>def</span> <span class='id identifier rubyid_font'>font</span>
  <span class='const'>Font</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="format-instance_method">
  
    - (<tt><span class='object_link'><a href="Format.html" title="RubyMotionQuery::Format (class)">Format</a></span></tt>) <strong>format</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Format.html" title="RubyMotionQuery::Format (class)">Format</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


4
5
6</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/format.rb', line 4</span>

<span class='kw'>def</span> <span class='id identifier rubyid_format'>format</span>
  <span class='const'>Format</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="get-instance_method">
  
    - (<tt><span class='object_link'><a href="../UIView.html" title="UIView (class)">UIView</a></span> or Array</tt>) <strong>get</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns a view or array of views.  Normally used to get the only view in
selected.</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='comment'># returns my_view
</span><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span>

<span class='comment'># returns an array
</span><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='const'>UILabel</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span>

<span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_foo'>foo</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_parent'>parent</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='period'>.</span><span class='id identifier rubyid_some_method_on_parent'>some_method_on_parent</span></code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="../UIView.html" title="UIView (class)">UIView</a></span> or Array</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


137
138
139
140
141
142
143
144</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 137</span>

<span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span>
  <span class='id identifier rubyid_sel'>sel</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_selected'>selected</span>
  <span class='kw'>if</span> <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>1</span>
    <span class='id identifier rubyid_sel'>sel</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
  <span class='kw'>else</span>
    <span class='id identifier rubyid_sel'>sel</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="grep-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>grep</strong>(&amp;block) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


50
51
52
53</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/enumerablish.rb', line 50</span>

<span class='kw'>def</span> <span class='id identifier rubyid_grep'>grep</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
  <span class='kw'>return</span> <span class='kw'>self</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block'>block</span>
  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_grep'>grep</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='ivar'>@selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="hide-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>hide</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


41
42
43
44</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/actions.rb', line 41</span>

<span class='kw'>def</span> <span class='id identifier rubyid_hide'>hide</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_hidden'>hidden</span> <span class='op'>=</span> <span class='kw'>true</span> <span class='rbrace'>}</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="image-instance_method">
  
    - (<tt><span class='object_link'><a href="ImageUtils.html" title="RubyMotionQuery::ImageUtils (class)">ImageUtils</a></span></tt>) <strong>image</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="ImageUtils.html" title="RubyMotionQuery::ImageUtils (class)">ImageUtils</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


9
10
11</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/image.rb', line 9</span>

<span class='kw'>def</span> <span class='id identifier rubyid_image'>image</span>
  <span class='const'>ImageUtils</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="inject-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>inject</strong>(o, &amp;block) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='reduce-instance_method'>reduce</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


62
63
64
65</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/enumerablish.rb', line 62</span>

<span class='kw'>def</span> <span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='id identifier rubyid_o'>o</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
  <span class='kw'>return</span> <span class='kw'>self</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block'>block</span>
  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='id identifier rubyid_o'>o</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='ivar'>@selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="inspect-instance_method">
  
    - (<tt>String</tt>) <strong>inspect</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Changed inspect to be useful</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code>(main)&gt; rmq.all
=&gt; RMQ 172658240. 26 selected. selectors: []. .log for more info</code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


176
177
178
179
180</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 176</span>

<span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>RMQ </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='rbrace'>}</span><span class='tstring_content'>. </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='rbrace'>}</span><span class='tstring_content'> selected. selectors: </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_selectors'>selectors</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbrace'>}</span><span class='tstring_content'>. .log for more info</span><span class='tstring_end'>&quot;</span></span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='rbrace'>}</span><span class='tstring_content'>]</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span> <span class='op'>==</span> <span class='int'>1</span>
  <span class='id identifier rubyid_out'>out</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="last-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>last</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


73
74
75</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/enumerablish.rb', line 73</span>

<span class='kw'>def</span> <span class='id identifier rubyid_last'>last</span>
  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="length-instance_method">
  
    - (<tt>Integer</tt>) <strong>length</strong> 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='size-instance_method'>size</span>, <span id='count-instance_method'>count</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns number of views selected</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>number of views selected</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


83
84
85</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/enumerablish.rb', line 83</span>

<span class='kw'>def</span> <span class='id identifier rubyid_length'>length</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="location_in-instance_method">
  
    - (<tt>Array</tt>) <strong>location_in</strong>(view) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns or [CGSize]</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Array</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>or [CGSize]</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


98
99
100
101
102
103
104
105</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/position.rb', line 98</span>

<span class='kw'>def</span> <span class='id identifier rubyid_location_in'>location_in</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_selected_view'>selected_view</span><span class='op'>|</span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_selected_view'>selected_view</span><span class='period'>.</span><span class='id identifier rubyid_convertRect'>convertRect</span><span class='lparen'>(</span><span class='id identifier rubyid_selected_view'>selected_view</span><span class='period'>.</span><span class='id identifier rubyid_bounds'>bounds</span><span class='comma'>,</span> <span class='label'>toView:</span> <span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span>
  <span class='kw'>end</span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>=</span> <span class='id identifier rubyid_out'>out</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='kw'>if</span> <span class='id identifier rubyid_out'>out</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>1</span>
  <span class='id identifier rubyid_out'>out</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="location_in_root_view-instance_method">
  
    - (<tt>Array</tt>) <strong>location_in_root_view</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns or [CGSize]</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Array</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>or [CGSize]</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


93
94
95</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/position.rb', line 93</span>

<span class='kw'>def</span> <span class='id identifier rubyid_location_in_root_view'>location_in_root_view</span>
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_location_in'>location_in</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_root_view'>root_view</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="log-instance_method">
  
    - (<tt>String</tt>) <strong>log</strong>(opt = nil) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Super useful in the console. log outputs to the console a table of the
selected views</p>

<p>log in a tree form</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code>(main)&gt; rmq(UIImageView).log

object_id   | class                 | style_name              | frame                           |
sv id       | superview             | subviews count          | tags                            |
- - - - - - | - - - - - - - - - - - | - - - - - - - - - - - - | - - - - - - - - - - - - - - - - |
168150976   | UIImageView           | logo                    | {l: 60, t: 10, w: 200, h: 95.5} |
168128784   | UIView                | 0                       |                                 |
- - - - - - | - - - - - - - - - - - | - - - - - - - - - - - - | - - - - - - - - - - - - - - - - |
168180640   | UIImageView           |                         | {l: 1, t: 1, w: 148, h: 19}     |
168173616   | UIRoundedRectButton   | 0                       |                                 |
- - - - - - | - - - - - - - - - - - | - - - - - - - - - - - - | - - - - - - - - - - - - - - - - |
168204336   | UIImageView           |                         | {l: 1, t: 0, w: 77, h: 27}      |
168201952   | _UISwitchInternalView | 0                       |                                 |
- - - - - - | - - - - - - - - - - - | - - - - - - - - - - - - | - - - - - - - - - - - - - - - - |
172600352   | UIImageView           |                         | {l: -2, t: 0, w: 79, h: 27}     |
168204512   | UIView                | 0                       |                                 |
- - - - - - | - - - - - - - - - - - | - - - - - - - - - - - - | - - - - - - - - - - - - - - - - |
168205504   | UIImageView           |                         | {l: -2, t: 0, w: 131, h: 27}    |
168204512   | UIView                | 0                       |                                 |
- - - - - - | - - - - - - - - - - - | - - - - - - - - - - - - | - - - - - - - - - - - - - - - - |
168205600   | UIImageView           |                         | {l: 49, t: 0, w: 29, h: 27}     |
168204512   | UIView                | 0                       |                                 |
- - - - - - | - - - - - - - - - - - | - - - - - - - - - - - - | - - - - - - - - - - - - - - - - |
RMQ 278442176. 6 selected. selectors: [UIImageView]#</code></pre>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='period'>.</span><span class='id identifier rubyid_log'>log</span> <span class='symbol'>:tree</span></code></pre>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='period'>.</span><span class='id identifier rubyid_log'>log</span> <span class='symbol'>:wide</span></code></pre>
    
  </div>
<p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>:wide</span>
      
      
        <span class='type'></span>
      
      
      
        &mdash;
        <div class='inline'>
<p>outputs wide format (really wide, but awesome: rmq.all.log :wide). :tree
outputs the</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 220</span>

<span class='kw'>def</span> <span class='id identifier rubyid_log'>log</span><span class='lparen'>(</span><span class='id identifier rubyid_opt'>opt</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
  <span class='kw'>if</span> <span class='id identifier rubyid_opt'>opt</span> <span class='op'>==</span> <span class='symbol'>:tree</span>
    <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_tree_to_s'>tree_to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_selected'>selected</span><span class='rparen'>)</span> 
    <span class='kw'>return</span>
  <span class='kw'>end</span>

  <span class='id identifier rubyid_wide'>wide</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_opt'>opt</span> <span class='op'>==</span> <span class='symbol'>:wide</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>=</span>  <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n object_id   | class                 | style_name              | frame                           |</span><span class='tstring_end'>&quot;</span></span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_wide'>wide</span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span>   <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> sv id       | superview             | subviews count          | tags                            |</span><span class='tstring_end'>&quot;</span></span>
  <span class='id identifier rubyid_line'>line</span> <span class='op'>=</span>   <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> - - - - - - | - - - - - - - - - - - | - - - - - - - - - - - - | - - - - - - - - - - - - - - - - |\n</span><span class='tstring_end'>&quot;</span></span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_chop'>chop</span> <span class='kw'>if</span> <span class='id identifier rubyid_wide'>wide</span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_line'>line</span>

  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span> 
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='int'>12</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>|</span><span class='tstring_end'>&quot;</span></span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>21</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='int'>22</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>|</span><span class='tstring_end'>&quot;</span></span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_style_name'>style_name</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>23</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='int'>24</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>|</span><span class='tstring_end'>&quot;</span></span>

    <span class='id identifier rubyid_s'>s</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
    <span class='kw'>if</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span>
      <span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>#0.#</span><span class='tstring_end'>'</span></span>
      <span class='id identifier rubyid_s'>s</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> {l: </span><span class='embexpr_beg'>#{</span><span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_numeric'>numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span><span class='period'>.</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
      <span class='id identifier rubyid_s'>s</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, t: </span><span class='embexpr_beg'>#{</span><span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_numeric'>numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span><span class='period'>.</span><span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
      <span class='id identifier rubyid_s'>s</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, w: </span><span class='embexpr_beg'>#{</span><span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_numeric'>numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
      <span class='id identifier rubyid_s'>s</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, h: </span><span class='embexpr_beg'>#{</span><span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_numeric'>numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>}</span><span class='tstring_end'>&quot;</span></span>
    <span class='kw'>end</span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_s'>s</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='int'>33</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>|</span><span class='tstring_end'>'</span></span>

    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_wide'>wide</span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_superview'>superview</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='int'>12</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>|</span><span class='tstring_end'>&quot;</span></span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_superview'>superview</span> <span class='op'>?</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_superview'>superview</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>21</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='int'>22</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>|</span><span class='tstring_end'>&quot;</span></span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_subviews'>subviews</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='int'>23</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'> |</span><span class='tstring_end'>&quot;</span></span>
    <span class='comment'>#out &lt;&lt; &quot;  #{view.subviews.length.to_s.rjust(8)} #{view.superview.class.name.ljust(20)} #{view.superview.object_id.to_s.rjust(10)}&quot;
</span>    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_tag_names'>tag_names</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>,</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='int'>32</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>|</span><span class='tstring_end'>&quot;</span></span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_line'>line</span> <span class='kw'>unless</span> <span class='id identifier rubyid_wide'>wide</span>
  <span class='kw'>end</span>

  <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>RMQ </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='rbrace'>}</span><span class='tstring_content'>. </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='rbrace'>}</span><span class='tstring_content'> selected. selectors: </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_selectors'>selectors</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>

  <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_out'>out</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="map-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>map</strong>(&amp;block) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='collect-instance_method'>collect</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


31
32
33
34</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/enumerablish.rb', line 31</span>

<span class='kw'>def</span> <span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
  <span class='kw'>return</span> <span class='kw'>self</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block'>block</span>
  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='ivar'>@selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="move-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>move</strong>(opts) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='resize-instance_method'>resize</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/position.rb', line 5</span>

<span class='kw'>def</span> <span class='id identifier rubyid_move'>move</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span> 
  <span class='comment'># TODO, add centered and from_bottom and from_top, and bottom and top
</span>  <span class='comment'># TODO, add animate option
</span>  <span class='id identifier rubyid_left'>left</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:left</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:l</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:x</span><span class='rbracket'>]</span>
  <span class='id identifier rubyid_top'>top</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:top</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:t</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:y</span><span class='rbracket'>]</span>
  <span class='id identifier rubyid_width'>width</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:width</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:w</span><span class='rbracket'>]</span>
  <span class='id identifier rubyid_height'>height</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:height</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:h</span><span class='rbracket'>]</span>

  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_frame'>frame</span> <span class='op'>=</span> <span class='lbracket'>[</span>
      <span class='lbracket'>[</span><span class='id identifier rubyid_left'>left</span> <span class='op'>||</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span><span class='period'>.</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_top'>top</span> <span class='op'>||</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span><span class='period'>.</span><span class='id identifier rubyid_y'>y</span><span class='rbracket'>]</span><span class='comma'>,</span>
      <span class='lbracket'>[</span><span class='id identifier rubyid_width'>width</span> <span class='op'>||</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span><span class='comma'>,</span> <span class='id identifier rubyid_height'>height</span> <span class='op'>||</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span><span class='rbracket'>]</span>
    <span class='rbracket'>]</span>
  <span class='kw'>end</span>

  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="next-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>next</strong>(*working_selectors) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns Sibling above to the selected view(s)</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_next'>next</span><span class='lparen'>(</span><span class='const'>UITextField</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_focus'>focus</span></code></pre>
    
  </div>
<p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>selectors</span>
      
      
        <span class='type'></span>
      
      
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Sibling above to the selected view(s)</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


200
201
202
203
204
205
206
207
208
209
210</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 200</span>

<span class='kw'>def</span> <span class='kw'>next</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_normalize_selectors'>normalize_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>

  <span class='id identifier rubyid_filter'>filter</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_subs'>subs</span> <span class='op'>=</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_superview'>superview</span><span class='period'>.</span><span class='id identifier rubyid_subviews'>subviews</span>
    <span class='id identifier rubyid_location'>location</span> <span class='op'>=</span> <span class='id identifier rubyid_subs'>subs</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>if</span> <span class='id identifier rubyid_location'>location</span> <span class='op'>&lt;</span> <span class='id identifier rubyid_subs'>subs</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>-</span> <span class='int'>1</span>
      <span class='id identifier rubyid_subs'>subs</span><span class='lbracket'>[</span><span class='id identifier rubyid_location'>location</span> <span class='op'>+</span> <span class='int'>1</span><span class='rbracket'>]</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="not-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>not</strong>(*working_selectors) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns A new rmq instance removing selected views that match selectors
provided</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='comment'># Entire family of labels from siblings on down
</span><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_label'>my_label</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_parent'>parent</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='const'>UILabel</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_not'>not</span><span class='lparen'>(</span><span class='id identifier rubyid_my_label'>my_label</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_move'>move</span><span class='lparen'>(</span><span class='label'>left:</span> <span class='int'>10</span><span class='rparen'>)</span></code></pre>
    
  </div>
<p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>selectors</span>
      
      
        <span class='type'></span>
      
      
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>A new rmq instance removing selected views that match selectors provided</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


64
65
66
67
68
69
70
71</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 64</span>

<span class='kw'>def</span> <span class='kw'>not</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
  <span class='kw'>return</span> <span class='kw'>self</span> <span class='kw'>unless</span> <span class='id identifier rubyid_working_selectors'>working_selectors</span>
  <span class='id identifier rubyid_normalize_selectors'>normalize_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>

  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='comma'>,</span> <span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="nudge-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>nudge</strong>(opts) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


25
26
27
28
29
30
31
32
33
34
35
36
37
38</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/position.rb', line 25</span>

<span class='kw'>def</span> <span class='id identifier rubyid_nudge'>nudge</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span> 
  <span class='id identifier rubyid_left'>left</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:left</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:l</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>0</span>
  <span class='id identifier rubyid_right'>right</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:right</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:r</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>0</span>
  <span class='id identifier rubyid_up'>up</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:up</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:u</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>0</span>
  <span class='id identifier rubyid_down'>down</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:down</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:d</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>0</span>

  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_f'>f</span> <span class='op'>=</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_frame'>frame</span>
    <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span><span class='period'>.</span><span class='id identifier rubyid_x'>x</span> <span class='op'>-</span> <span class='id identifier rubyid_left'>left</span> <span class='op'>+</span> <span class='id identifier rubyid_right'>right</span><span class='comma'>,</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span><span class='period'>.</span><span class='id identifier rubyid_y'>y</span> <span class='op'>+</span> <span class='id identifier rubyid_down'>down</span> <span class='op'>-</span> <span class='id identifier rubyid_up'>up</span><span class='rbracket'>]</span>
    <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_frame'>frame</span> <span class='op'>=</span> <span class='id identifier rubyid_f'>f</span>
  <span class='kw'>end</span>

  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="off-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>off</strong>(*events) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Removes events/gestures from all views selected</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


94
95
96
97
98
99
100</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/events.rb', line 94</span>

<span class='kw'>def</span> <span class='id identifier rubyid_off'>off</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_events'>events</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_events'>events</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_off'>off</span><span class='lparen'>(</span><span class='id identifier rubyid_events'>events</span><span class='rparen'>)</span>
  <span class='kw'>end</span>

  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="on-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>on</strong>(event, args = {}, &amp;block) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Options for gestures</p>

<pre class="code ruby"><code class="ruby"><span class='symbol'>:cancels_touches_in_view</span> 
<span class='symbol'>:delegate</span> 
<span class='symbol'>:taps_required</span> 
<span class='symbol'>:fingers_required</span> 
<span class='symbol'>:maximum_number_of_touches</span> 
<span class='symbol'>:minimum_number_of_touches</span> 
<span class='symbol'>:allowable_movement</span> 
<span class='symbol'>:minimum_press_duration</span> 
<span class='symbol'>:direction</span> 
<span class='symbol'>:rotation</span> 
<span class='symbol'>:scale</span></code></pre>

<p>rmq.append(UIButton).on(:touch) do |sender|</p>

<pre class="code ruby"><code class="ruby"><span class='comment'># Do something when button is touched</span></code></pre>

<p>end</p>

<p>rmq(my_view).on(:tap, taps_required: 2 ) do |sender, event|</p>

<pre class="code ruby"><code class="ruby"><span class='comment'># Do something when event fires</span></code></pre>

<p>end</p>

<p># These both are the same rmq(button).on(:tap, init:
-&gt;(recongnizer){recongnizer.numberOfTapsRequired = 2) do |sender|</p>

<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>tapped</span><span class='tstring_end'>'</span></span></code></pre>

<p>end</p>

<p>rmq(button).on(:tap, taps_required: 2) do |sender|</p>

<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>tapped</span><span class='tstring_end'>'</span></span></code></pre>

<p>end</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


83
84
85
86
87
88
89</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/events.rb', line 83</span>

<span class='kw'>def</span> <span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_events'>events</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='comma'>,</span> <span class='id identifier rubyid_event'>event</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> 
  <span class='kw'>end</span>

  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="origin_views-instance_method">
  
    - (<tt>Array</tt>) <strong>origin_views</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>The view(s) this rmq was derived from</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Array</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


116
117
118
119
120
121
122</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 116</span>

<span class='kw'>def</span> <span class='id identifier rubyid_origin_views'>origin_views</span>
  <span class='kw'>if</span> <span class='id identifier rubyid_pq'>pq</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parent_rmq'>parent_rmq</span>
    <span class='id identifier rubyid_pq'>pq</span><span class='period'>.</span><span class='id identifier rubyid_selected'>selected</span>
  <span class='kw'>else</span>
    <span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span><span class='period'>.</span><span class='id identifier rubyid_view'>view</span><span class='rbracket'>]</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="parent-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>parent</strong> 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='superview-instance_method'>superview</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns rmq instance selecting the parent of the selected view(s)</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_parent'>parent</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='symbol'>:delete_button</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_toggle_enabled'>toggle_enabled</span></code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>rmq instance selecting the parent of the selected view(s)</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


101
102
103</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 101</span>

<span class='kw'>def</span> <span class='id identifier rubyid_parent'>parent</span>
  <span class='id identifier rubyid_closest'>closest</span><span class='lparen'>(</span><span class='const'>UIView</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="parent_rmq-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>parent_rmq</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Untested and I don' think it's getting set right in some situations</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>rmq that created this rmq, if any</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


106
107
108</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 106</span>

<span class='kw'>def</span> <span class='id identifier rubyid_parent_rmq'>parent_rmq</span>
  <span class='ivar'>@_parent_rmq</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="parent_rmq=-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>parent_rmq=</strong>(value) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


109
110
111</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 109</span>

<span class='kw'>def</span> <span class='id identifier rubyid_parent_rmq='>parent_rmq=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
  <span class='ivar'>@_parent_rmq</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="parents-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>parents</strong>(*working_selectors) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='superviews-instance_method'>superviews</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>of the selected view(s)</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_parents'>parents</span><span class='period'>.</span><span class='id identifier rubyid_log'>log</span></code></pre>
    
  </div>
<p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>selectors</span>
      
      
        <span class='type'></span>
      
      
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Instance selecting the parents, grandparents, etc, all the way up the tree</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 113</span>

<span class='kw'>def</span> <span class='id identifier rubyid_parents'>parents</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_normalize_selectors'>normalize_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>

  <span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span><span class='label'>uniq:</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_superviews'>superviews</span> <span class='op'>=</span> <span class='id identifier rubyid_all_superviews_for'>all_superviews_for</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>

    <span class='kw'>if</span> <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_is_blank?'>is_blank?</span><span class='lparen'>(</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
      <span class='id identifier rubyid_superviews'>superviews</span>
    <span class='kw'>else</span>
      <span class='id identifier rubyid_superviews'>superviews</span><span class='period'>.</span><span class='id identifier rubyid_inject'>inject</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_subview'>subview</span><span class='comma'>,</span> <span class='id identifier rubyid_out'>out</span><span class='op'>|</span>
        <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_subview'>subview</span> <span class='kw'>if</span> <span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_subview'>subview</span><span class='comma'>,</span> <span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
        <span class='id identifier rubyid_out'>out</span>
      <span class='kw'>end</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="prev-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>prev</strong>(*working_selectors) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns Sibling below to the selected view(s)</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_prev'>prev</span><span class='lparen'>(</span><span class='const'>UITextField</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_focus'>focus</span></code></pre>
    
  </div>
<p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>selectors</span>
      
      
        <span class='type'></span>
      
      
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Sibling below to the selected view(s)</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


218
219
220
221
222
223
224
225
226
227
228</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 218</span>

<span class='kw'>def</span> <span class='id identifier rubyid_prev'>prev</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_normalize_selectors'>normalize_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>

  <span class='id identifier rubyid_filter'>filter</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_subs'>subs</span> <span class='op'>=</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_superview'>superview</span><span class='period'>.</span><span class='id identifier rubyid_subviews'>subviews</span>
    <span class='id identifier rubyid_location'>location</span> <span class='op'>=</span> <span class='id identifier rubyid_subs'>subs</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>if</span> <span class='id identifier rubyid_location'>location</span> <span class='op'>&gt;</span> <span class='int'>0</span>
      <span class='id identifier rubyid_subs'>subs</span><span class='lbracket'>[</span><span class='id identifier rubyid_location'>location</span> <span class='op'>-</span> <span class='int'>1</span><span class='rbracket'>]</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="reapply_styles-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>reapply_styles</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


45
46
47
48
49
50
51
52</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/stylesheet.rb', line 45</span>

<span class='kw'>def</span> <span class='id identifier rubyid_reapply_styles'>reapply_styles</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_selected_view'>selected_view</span><span class='op'>|</span>
    <span class='kw'>if</span> <span class='id identifier rubyid_style_name'>style_name</span> <span class='op'>=</span> <span class='id identifier rubyid_selected_view'>selected_view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_style_name'>style_name</span>
      <span class='id identifier rubyid_apply_style_to_view'>apply_style_to_view</span> <span class='id identifier rubyid_selected_view'>selected_view</span><span class='comma'>,</span> <span class='id identifier rubyid_style_name'>style_name</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="reject-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>reject</strong>(&amp;block) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


56
57
58
59</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/enumerablish.rb', line 56</span>

<span class='kw'>def</span> <span class='id identifier rubyid_reject'>reject</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
  <span class='kw'>return</span> <span class='kw'>self</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block'>block</span>
  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='ivar'>@selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="remove-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>remove</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


6
7
8
9</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/subviews.rb', line 6</span>

<span class='kw'>def</span> <span class='id identifier rubyid_remove'>remove</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_removeFromSuperview'>removeFromSuperview</span> <span class='rbrace'>}</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="resize_to_fit_subviews-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>resize_to_fit_subviews</strong> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/position.rb', line 72</span>

<span class='kw'>def</span> <span class='id identifier rubyid_resize_to_fit_subviews'>resize_to_fit_subviews</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_st'>st</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_styler_for'>styler_for</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>

    <span class='id identifier rubyid_w'>w</span> <span class='op'>=</span> <span class='int'>0</span>
    <span class='id identifier rubyid_h'>h</span> <span class='op'>=</span> <span class='int'>0</span>

    <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_subviews'>subviews</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_subview'>subview</span><span class='op'>|</span>
      <span class='id identifier rubyid_sub_st'>sub_st</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_styler_for'>styler_for</span><span class='lparen'>(</span><span class='id identifier rubyid_subview'>subview</span><span class='rparen'>)</span>
      <span class='id identifier rubyid_w'>w</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_sub_st'>sub_st</span><span class='period'>.</span><span class='id identifier rubyid_right'>right</span><span class='comma'>,</span> <span class='id identifier rubyid_w'>w</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span>
      <span class='id identifier rubyid_h'>h</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_sub_st'>sub_st</span><span class='period'>.</span><span class='id identifier rubyid_bottom'>bottom</span><span class='comma'>,</span> <span class='id identifier rubyid_h'>h</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_max'>max</span>
    <span class='kw'>end</span>

    <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span> <span class='op'>=</span> <span class='id identifier rubyid_w'>w</span> <span class='kw'>if</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span> <span class='op'>&lt;</span> <span class='id identifier rubyid_w'>w</span>
    <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span> <span class='op'>=</span> <span class='id identifier rubyid_h'>h</span> <span class='kw'>if</span> <span class='id identifier rubyid_st'>st</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span> <span class='op'>&lt;</span> <span class='id identifier rubyid_h'>h</span>
  <span class='kw'>end</span>

  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="root?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>root?</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Is this rmq a root instance?</p>

<p>Which means it only has 1 selected view, and that view is the view you
called rmq in. Which is a tad confusing, but if you call <b>just</b> rmq
inside a  view, then only that view will be <b>selected</b> and this rmq
will be <b>root</b>. If you call rmq inside a controller, only
controller.view will be selected and the rma instance will be a root.</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


152
153
154</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 152</span>

<span class='kw'>def</span> <span class='id identifier rubyid_root?'>root?</span>
  <span class='lparen'>(</span><span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='lparen'>(</span><span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='op'>==</span> <span class='ivar'>@context</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="root_view-instance_method">
  
    - (<tt><span class='object_link'><a href="../UIView.html" title="UIView (class)">UIView</a></span></tt>) <strong>root_view</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns Root view of this rmq instance’s controller</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='period'>.</span><span class='id identifier rubyid_root_view'>root_view</span></code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="../UIView.html" title="UIView (class)">UIView</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Root view of this rmq instance’s controller</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


296
297
298
299
300
301
302
303</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 296</span>

<span class='kw'>def</span> <span class='id identifier rubyid_root_view'>root_view</span>
  <span class='id identifier rubyid_vc'>vc</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span>
  <span class='kw'>if</span> <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_is_blank?'>is_blank?</span><span class='lparen'>(</span><span class='id identifier rubyid_vc'>vc</span><span class='rparen'>)</span>
    <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_context_or_context_view'>context_or_context_view</span>
  <span class='kw'>else</span>
    <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span><span class='period'>.</span><span class='id identifier rubyid_view'>view</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="select-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>select</strong>(&amp;block) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


38
39
40
41</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/enumerablish.rb', line 38</span>

<span class='kw'>def</span> <span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
  <span class='kw'>return</span> <span class='kw'>self</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block'>block</span>
  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='ivar'>@selectors</span><span class='comma'>,</span> <span class='ivar'>@context</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="selected-instance_method">
  
    - (<tt>Array</tt>) <strong>selected</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>The UIViews currently selected</p>

<p>Use <span class='object_link'><a href="#get-instance_method" title="RubyMotionQuery::RMQ#get (method)">#get</a></span> instead to get the actual UIView objects</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Array</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 53</span>

<span class='kw'>def</span> <span class='id identifier rubyid_selected'>selected</span>
  <span class='kw'>if</span> <span class='ivar'>@selected_dirty</span>
    <span class='ivar'>@_selected</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>

    <span class='kw'>if</span> <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_is_blank?'>is_blank?</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_selectors'>selectors</span><span class='rparen'>)</span>
      <span class='ivar'>@_selected</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_context_or_context_view'>context_or_context_view</span>
    <span class='kw'>else</span>
      <span class='id identifier rubyid_working_selectors'>working_selectors</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_selectors'>selectors</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
      <span class='id identifier rubyid_extract_views_from_selectors'>extract_views_from_selectors</span><span class='lparen'>(</span><span class='ivar'>@_selected</span><span class='comma'>,</span> <span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>

      <span class='kw'>unless</span> <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_is_blank?'>is_blank?</span><span class='lparen'>(</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
        <span class='id identifier rubyid_subviews'>subviews</span> <span class='op'>=</span> <span class='id identifier rubyid_all_subviews_for'>all_subviews_for</span><span class='lparen'>(</span><span class='id identifier rubyid_root_view'>root_view</span><span class='rparen'>)</span>
        <span class='id identifier rubyid_subviews'>subviews</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_subview'>subview</span><span class='op'>|</span>
          <span class='ivar'>@_selected</span>  <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_subview'>subview</span> <span class='kw'>if</span> <span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='id identifier rubyid_subview'>subview</span><span class='comma'>,</span> <span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
        <span class='kw'>end</span>
      <span class='kw'>end</span>

      <span class='ivar'>@_selected</span><span class='period'>.</span><span class='id identifier rubyid_uniq!'>uniq!</span>
    <span class='kw'>end</span>

    <span class='ivar'>@selected_dirty</span> <span class='op'>=</span> <span class='kw'>false</span>
  <span class='kw'>else</span>
    <span class='ivar'>@_selected</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
  <span class='kw'>end</span>

  <span class='ivar'>@_selected</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="selected=-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>selected=</strong>(value) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Do not use</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


43
44
45
46</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 43</span>

<span class='kw'>def</span> <span class='id identifier rubyid_selected='>selected=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
  <span class='ivar'>@_selected</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
  <span class='ivar'>@selected_dirty</span> <span class='op'>=</span> <span class='kw'>false</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="selectors-instance_method">
  
    - (<tt>Array</tt>) <strong>selectors</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns The selectors, which is what you used for the query</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code>(main)&gt; rmq(UILabel, UIImageView).selectors
=&gt; [UILabel, UIImageView] </code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Array</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The selectors, which is what you used for the query</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


15
16
17</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/selectors.rb', line 15</span>

<span class='kw'>def</span> <span class='id identifier rubyid_selectors'>selectors</span>
  <span class='ivar'>@_selectors</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="selectors=-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>selectors=</strong>(value) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Do not use</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


5
6
7
8
9</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/selectors.rb', line 5</span>

<span class='kw'>def</span> <span class='id identifier rubyid_selectors='>selectors=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
  <span class='ivar'>@selected_dirty</span> <span class='op'>=</span> <span class='kw'>true</span>
  <span class='id identifier rubyid_normalize_selectors'>normalize_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
  <span class='ivar'>@_selectors</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="send-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>send</strong>(method, args = nil) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


15
16
17
18
19
20
21
22
23
24</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/actions.rb', line 15</span>

<span class='kw'>def</span> <span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='kw'>if</span> <span class='id identifier rubyid_args'>args</span>
      <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid___send__'>__send__</span> <span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span>
    <span class='kw'>else</span>
      <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid___send__'>__send__</span> <span class='id identifier rubyid_method'>method</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="show-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>show</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


47
48
49
50</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/actions.rb', line 47</span>

<span class='kw'>def</span> <span class='id identifier rubyid_show'>show</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_hidden'>hidden</span> <span class='op'>=</span> <span class='kw'>false</span> <span class='rbrace'>}</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="siblings-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>siblings</strong>(*working_selectors) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns Siblings of the selected view(s)</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_siblings'>siblings</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:poke</span><span class='rparen'>)</span></code></pre>
    
  </div>
<p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>selectors</span>
      
      
        <span class='type'></span>
      
      
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Siblings of the selected view(s)</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


187
188
189
190
191</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 187</span>

<span class='kw'>def</span> <span class='id identifier rubyid_siblings'>siblings</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_normalize_selectors'>normalize_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_working_selectors'>working_selectors</span><span class='rparen'>)</span>

  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parent'>parent</span><span class='period'>.</span><span class='id identifier rubyid_children'>children</span><span class='period'>.</span><span class='id identifier rubyid_not'>not</span><span class='lparen'>(</span><span class='id identifier rubyid_selected'>selected</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="style-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>style</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


37
38
39
40
41
42</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/stylesheet.rb', line 37</span>

<span class='kw'>def</span> <span class='id identifier rubyid_style'>style</span><span class='lparen'>(</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='kw'>yield</span><span class='lparen'>(</span><span class='id identifier rubyid_styler_for'>styler_for</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span><span class='rparen'>)</span>
  <span class='kw'>end</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="styler_for-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>styler_for</strong>(view) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/stylesheet.rb', line 54</span>

<span class='kw'>def</span> <span class='id identifier rubyid_styler_for'>styler_for</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
  <span class='comment'># TODO should have a pool of stylers to reuse, or just assume single threaded and 
</span>  <span class='comment'># memoize this, however if you do that, make sure the dev doesn't retain them in a var
</span>  <span class='id identifier rubyid_custom_stylers'>custom_stylers</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='kw'>begin</span>
    <span class='kw'>case</span> <span class='id identifier rubyid_view'>view</span>
    <span class='kw'>when</span> <span class='const'>UILabel</span>              <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UILabelStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UIButton</span>             <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UIButtonStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UIImageView</span>          <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UIImageViewStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UITableView</span>          <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UITableViewStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UISwitch</span>             <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UISwitchStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UIDatePicker</span>         <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UIDatePickerStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UISegmentedControl</span>   <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UISegmentedControlStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UIRefreshControl</span>     <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UIRefreshControlStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UIPageControl</span>        <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UIPageControlStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UISlider</span>             <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UISliderStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UIStepper</span>            <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UIStepperStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UITabBar</span>             <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UITabBarStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UITableViewCell</span>      <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UITableViewCellStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UITextView</span>           <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UITextViewStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UITextField</span>          <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UITextFieldStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UINavigationBar</span>      <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UINavigationBarStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>when</span> <span class='const'>UIScrollView</span>         <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UIScrollViewStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='comment'># TODO, all the controls are done, but missing some views, add
</span>    <span class='kw'>when</span> <span class='const'>UIControl</span>            <span class='kw'>then</span> <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UIControlStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>else</span>
      <span class='const'>Stylers</span><span class='op'>::</span><span class='const'>UIViewStyler</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="stylesheet-instance_method">
  
    - (<tt><span class='object_link'><a href="Stylesheet.html" title="RubyMotionQuery::Stylesheet (class)">RubyMotionQuery::Stylesheet</a></span></tt>) <strong>stylesheet</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Stylesheet.html" title="RubyMotionQuery::Stylesheet (class)">RubyMotionQuery::Stylesheet</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


17
18
19
20
21
22
23
24
25
26</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/stylesheet.rb', line 17</span>

<span class='kw'>def</span> <span class='id identifier rubyid_stylesheet'>stylesheet</span>
  <span class='ivar'>@_stylesheet</span> <span class='op'>||=</span> <span class='kw'>begin</span>

    <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span> <span class='op'>&amp;&amp;</span> <span class='lparen'>(</span><span class='id identifier rubyid_ss'>ss</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_stylesheet'>stylesheet</span><span class='rparen'>)</span>
      <span class='id identifier rubyid_ss'>ss</span>
    <span class='kw'>elsif</span> <span class='lparen'>(</span><span class='id identifier rubyid_prmq'>prmq</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parent_rmq'>parent_rmq</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_prmq'>prmq</span><span class='period'>.</span><span class='id identifier rubyid_stylesheet'>stylesheet</span>
      <span class='id identifier rubyid_prmq'>prmq</span><span class='period'>.</span><span class='id identifier rubyid_stylesheet'>stylesheet</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="stylesheet=-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>stylesheet=</strong>(value) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


5
6
7
8
9
10
11
12
13
14</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/stylesheet.rb', line 5</span>

<span class='kw'>def</span> <span class='id identifier rubyid_stylesheet='>stylesheet=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_controller'>controller</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span>

  <span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>RubyMotionQuery</span><span class='op'>::</span><span class='const'>Stylesheet</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_controller'>controller</span><span class='rparen'>)</span>
  <span class='kw'>end</span>
  <span class='ivar'>@_stylesheet</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
  <span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_stylesheet'>stylesheet</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="tag-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>tag</strong>(*tag_or_tags) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Add tags You can optionally store a value in the tag, which can be super
useful in some rare situations</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_tag'>tag</span><span class='lparen'>(</span><span class='symbol'>:your_tag</span><span class='rparen'>)</span>
<span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_clear_tags'>clear_tags</span><span class='period'>.</span><span class='id identifier rubyid_tag'>tag</span><span class='lparen'>(</span><span class='symbol'>:your_new_tag</span><span class='rparen'>)</span>
<span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='const'>UILabel</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_tag'>tag</span><span class='lparen'>(</span><span class='symbol'>:selected</span><span class='comma'>,</span> <span class='symbol'>:customer</span><span class='rparen'>)</span></code></pre>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_tag'>tag</span><span class='lparen'>(</span><span class='label'>your_tag:</span> <span class='int'>22</span><span class='rparen'>)</span>
<span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_tag'>tag</span><span class='lparen'>(</span><span class='label'>your_tag:</span> <span class='int'>22</span><span class='comma'>,</span> <span class='label'>your_other_tag:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Hello world</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span></code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


16
17
18
19
20
21</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/tags.rb', line 16</span>

<span class='kw'>def</span> <span class='id identifier rubyid_tag'>tag</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_tag_or_tags'>tag_or_tags</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span>
    <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_tag'>tag</span><span class='lparen'>(</span><span class='id identifier rubyid_tag_or_tags'>tag_or_tags</span><span class='rparen'>)</span>
  <span class='kw'>end</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="to_a-instance_method">
  
    - (<tt>Array</tt>) <strong>to_a</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Array</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


78
79
80</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/enumerablish.rb', line 78</span>

<span class='kw'>def</span> <span class='id identifier rubyid_to_a'>to_a</span>
  <span class='id identifier rubyid_selected'>selected</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="toggle-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>toggle</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


53
54
55
56</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/actions.rb', line 53</span>

<span class='kw'>def</span> <span class='id identifier rubyid_toggle'>toggle</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_hidden'>hidden</span> <span class='op'>=</span> <span class='op'>!</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_hidden?'>hidden?</span> <span class='rbrace'>}</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="toggle_enabled-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>toggle_enabled</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


59
60
61
62</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/actions.rb', line 59</span>

<span class='kw'>def</span> <span class='id identifier rubyid_toggle_enabled'>toggle_enabled</span>
  <span class='id identifier rubyid_selected'>selected</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_enabled'>enabled</span> <span class='op'>=</span> <span class='op'>!</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_enabled?'>enabled?</span> <span class='rbrace'>}</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="tree_to_s-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>tree_to_s</strong>(selected_views, depth = 0) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 266</span>

<span class='kw'>def</span> <span class='id identifier rubyid_tree_to_s'>tree_to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_selected_views'>selected_views</span><span class='comma'>,</span> <span class='id identifier rubyid_depth'>depth</span> <span class='op'>=</span> <span class='int'>0</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_out'>out</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>

  <span class='id identifier rubyid_selected_views'>selected_views</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_view'>view</span><span class='op'>|</span> 
    <span class='id identifier rubyid_first'>first</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span> <span class='op'>==</span> <span class='id identifier rubyid_selected_views'>selected_views</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_last'>last</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span> <span class='op'>==</span> <span class='id identifier rubyid_selected_views'>selected_views</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='rparen'>)</span>

    <span class='kw'>if</span> <span class='id identifier rubyid_depth'>depth</span> <span class='op'>==</span> <span class='int'>0</span>
      <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span>
    <span class='kw'>else</span>
      <span class='int'>0</span><span class='period'>.</span><span class='id identifier rubyid_upto'>upto</span><span class='lparen'>(</span><span class='id identifier rubyid_depth'>depth</span> <span class='op'>-</span> <span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
        <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='lparen'>(</span><span class='id identifier rubyid_i'>i</span> <span class='op'>==</span> <span class='lparen'>(</span><span class='id identifier rubyid_depth'>depth</span> <span class='op'>-</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>    ├</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>    │</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
      <span class='kw'>end</span>
    <span class='kw'>end</span>

    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>───</span><span class='tstring_end'>'</span></span>

    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>21</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>  ( </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_style_name'>style_name</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>23</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'> )</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_style_name'>style_name</span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>  </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>  [ </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_tag_names'>tag_names</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>,</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'> ]</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_tag_names'>tag_names</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&gt;</span> <span class='int'>0</span>

    <span class='kw'>if</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span>
      <span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>#0.#</span><span class='tstring_end'>'</span></span>
      <span class='id identifier rubyid_s'>s</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>  {l: </span><span class='embexpr_beg'>#{</span><span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_numeric'>numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span><span class='period'>.</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
      <span class='id identifier rubyid_s'>s</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, t: </span><span class='embexpr_beg'>#{</span><span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_numeric'>numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_origin'>origin</span><span class='period'>.</span><span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
      <span class='id identifier rubyid_s'>s</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, w: </span><span class='embexpr_beg'>#{</span><span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_numeric'>numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
      <span class='id identifier rubyid_s'>s</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, h: </span><span class='embexpr_beg'>#{</span><span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_numeric'>numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span><span class='comma'>,</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span><span class='rbrace'>}</span><span class='tstring_content'>}</span><span class='tstring_end'>&quot;</span></span>
      <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_s'>s</span>
    <span class='kw'>end</span>

    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span>
    <span class='id identifier rubyid_out'>out</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_tree_to_s'>tree_to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_subviews'>subviews</span><span class='comma'>,</span> <span class='id identifier rubyid_depth'>depth</span> <span class='op'>+</span> <span class='int'>1</span><span class='rparen'>)</span>
  <span class='kw'>end</span>

  <span class='id identifier rubyid_out'>out</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="unshift-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>) <strong>unshift</strong>(view_or_constant, style = nil, opts = {}) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='prepend-instance_method'>prepend</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="RubyMotionQuery::RMQ (class)">RMQ</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


67
68
69
70
71</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/subviews.rb', line 67</span>

<span class='kw'>def</span> <span class='id identifier rubyid_unshift'>unshift</span><span class='lparen'>(</span><span class='id identifier rubyid_view_or_constant'>view_or_constant</span><span class='comma'>,</span> <span class='id identifier rubyid_style'>style</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:at_index</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='int'>0</span>
  <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:style</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_style'>style</span>
  <span class='id identifier rubyid_add_subview'>add_subview</span> <span class='id identifier rubyid_view_or_constant'>view_or_constant</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="version-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>version</strong> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


5
6
7</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/version.rb', line 5</span>

<span class='kw'>def</span> <span class='id identifier rubyid_version'>version</span>
  <span class='const'>RubyMotionQuery</span><span class='op'>::</span><span class='const'>VERSION</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="view_controller-instance_method">
  
    - (<tt><span class='object_link'><a href="../UIViewController.html" title="UIViewController (class)">UIViewController</a></span></tt>) <strong>view_controller</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>When you call rmq within a controller or view, a new instance of RMQ is
created with the selectors you may or may not have supplied. That instance
will determine what view_controller it should use for stuff like
traversing,  stylesheet, etc.</p>
<ul><li>
<p>rmq method called in a controller: that controller is used</p>
</li><li>
<p>rmq method called in a view and that view is within the subview tree of a
controller: that controller is used</p>
</li><li>
<p>rmq method called in a view and that view is NOT within any subview tree of
any controller (common in a UITableViewCell  for example). In this case it
will use the view's controller or the "current controller". Generally that
is what is desired, however there are some situations where another
controller should be used. In that situation create your own rmq instance
and assign the controller you'd rather use</p>
</li><li>
<p>if an rmq instance was created from another rmq instance, it will attempt
to the parent_rmq's controller, if it exists</p>
</li></ul>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span></code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="../UIViewController.html" title="UIViewController (class)">UIViewController</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Controller of this rmq instance</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 267</span>

<span class='kw'>def</span> <span class='id identifier rubyid_view_controller'>view_controller</span>
  <span class='kw'>if</span> <span class='ivar'>@_view_controller</span>
    <span class='ivar'>@_view_controller</span>
  <span class='kw'>else</span>
    <span class='kw'>if</span> <span class='ivar'>@context</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>UIViewController</span><span class='rparen'>)</span>
      <span class='ivar'>@context</span>
    <span class='kw'>else</span> <span class='comment'># view
</span>      <span class='id identifier rubyid_vc'>vc</span> <span class='op'>=</span> <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_controller_for_view'>controller_for_view</span><span class='lparen'>(</span><span class='ivar'>@context</span><span class='rparen'>)</span> <span class='op'>||</span>
        <span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parent_rmq'>parent_rmq</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parent_rmq'>parent_rmq</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span><span class='rparen'>)</span> <span class='op'>||</span>
        <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_app'>app</span><span class='period'>.</span><span class='id identifier rubyid_current_view_controller'>current_view_controller</span>

      <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span> <span class='op'>=</span> <span class='id identifier rubyid_vc'>vc</span>
      <span class='ivar'>@context</span><span class='period'>.</span><span class='id identifier rubyid_rmq_data'>rmq_data</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span> <span class='op'>=</span> <span class='ivar'>@_view_controller</span> <span class='kw'>if</span> <span class='ivar'>@context</span>

      <span class='ivar'>@_view_controller</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="view_controller=-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>view_controller=</strong>(value) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


285
286
287</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 285</span>

<span class='kw'>def</span> <span class='id identifier rubyid_view_controller='>view_controller=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
  <span class='ivar'>@_view_controller</span> <span class='op'>=</span> <span class='const'>RubyMotionQuery</span><span class='op'>::</span><span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_weak_ref'>weak_ref</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="weak_view_controller=-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>weak_view_controller=</strong>(value) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


288
289
290</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 288</span>

<span class='kw'>def</span> <span class='id identifier rubyid_weak_view_controller='>weak_view_controller=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
  <span class='ivar'>@_view_controller</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="window-instance_method">
  
    - (<tt>UIWindow</tt>) <strong>window</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns Window of the root_view</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_rmq'>rmq</span><span class='period'>.</span><span class='id identifier rubyid_window'>window</span></code></pre>
    
  </div>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>UIWindow</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Window of the root_view</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


309
310
311</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/traverse.rb', line 309</span>

<span class='kw'>def</span> <span class='id identifier rubyid_window'>window</span>
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_root_view'>root_view</span><span class='period'>.</span><span class='id identifier rubyid_window'>window</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="wrap-instance_method">
  
    - (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>wrap</strong>(*views) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Wraps 1 or more views in an rmq instance.</p>

<p>Normally you select a view or views using rmq(my_view). Which doesn't  work
if you have an instance of a RMQ, in which case it isn't a method. In some
cases you want to save an instance of rmq and use it like the rmq method,
for this you'd use #wrap</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_q'>q</span> <span class='op'>=</span> <span class='const'>RubyMotionQuery</span><span class='op'>::</span><span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>

<span class='comment'># Bad
</span><span class='id identifier rubyid_q'>q</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span> 

<span class='comment'># Good
</span><span class='id identifier rubyid_q'>q</span><span class='period'>.</span><span class='id identifier rubyid_wrap'>wrap</span><span class='lparen'>(</span><span class='id identifier rubyid_my_view'>my_view</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_view_controller'>view_controller</span></code></pre>
    
  </div>


</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


96
97
98
99
100</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/base.rb', line 96</span>

<span class='kw'>def</span> <span class='id identifier rubyid_wrap'>wrap</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_views'>views</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_views'>views</span><span class='period'>.</span><span class='id identifier rubyid_flatten!'>flatten!</span>
  <span class='id identifier rubyid_views'>views</span><span class='period'>.</span><span class='id identifier rubyid_select!'>select!</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>UIView</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
  <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_create_with_array_and_selectors'>create_with_array_and_selectors</span><span class='lparen'>(</span><span class='id identifier rubyid_views'>views</span><span class='comma'>,</span> <span class='id identifier rubyid_views'>views</span><span class='comma'>,</span> <span class='id identifier rubyid_views'>views</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='comma'>,</span> <span class='kw'>self</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

    <div id="footer">
  Generated on Sun Dec  8 20:15:51 2013 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.7.3 (ruby-1.9.3).
</div>

  </body>
</html>